package assignment

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method 'PUT'
        url value(consumer("api/v2/assignments/\\d+/visible"),
                producer("api/v2/assignments/1/visible"))
        headers {
            contentType(applicationJsonUtf8())
            header('id', 21)
        }
        body([

                "visibility" : true
        ])
        bodyMatchers {
            jsonPath('$.visibility', byRegex(anyBoolean()))
        }
    }
    response {
        status 204
    }
}